package Day29;

public class Person {
    public static void main(String[] args) {
        /*IA tiger = new Tiger();
        tiger.cry();
        IA tiger1 = new IA(){
            @Override
            public void cry() {
                System.out.println("老虎叫唤....");
            }
        };
        tiger1.cry();
        Father father = new Father("小周"){
            @Override
            public void test() {
                System.out.println("调用了test");
            }
        };
        father.test();
*/
        Outer04 o = new Outer04();
        o.method();
    }
}

class Outer04{
    private int n1 = 10;
   public void method(){
       new PPerson() {
           @Override
           public void say() {
               System.out.println("匿名内部类中say方法");
           }

           @Override
           public void ok(String name) {
               System.out.println("name = " + name);
           }
       }.say();
   }
}


class PPerson{
    public void  ok(String name){
        System.out.println(name);
    }

    public void say(){
        System.out.println("调用了say（）方法");
    }

}

class Tiger implements IA{
    @Override
    public void cry() {
        System.out.println("'老虎叫唤.....");
    }
}

interface IA{
    public  void cry();
}

class Father{
    public Father(String name) {
    }
    public void test(){

    }
}